#include <stdio.h>
#include <stdlib.h>
#include<math.h>
bool judge(int x){ //判断正整数x是否只有3，5，7这三个因子
    while (x%3==0) x=x/3;
    while (x%5==0) x=x/5;
    while (x%7==0) x=x/7;
    return x==1;
}

int find(int k){
    for (int x=2;k>0;x++){
        if (judge(x)) k--;
        if (k==0) return x;
    }
    return 0;
}


int main(){
     
    for (int i=1;i<9;i++)
    printf("%d\n",find(i));
 
    return 0;
    
}